package com.ptswitch.material.service;

import java.util.Collection;
import java.util.List;

import com.ptswitch.material.model.material.Material;

public interface MaterialService {
    static final int Init_BomMaterials = 1 << 0;
    static final int Init_Uploads = 1 << 1;
    static final int Init_ContractItems = 1 << 2;

    void testSpringAsync();

    //must declare in interface for execute with db session
    void testSpringScheduled();

    void saveAll(Collection<Material> newMaterials, Collection<Material> oldMaterials, Collection<Material> updateMaterials);

    Material findById(long id);

    Material findById(long id, int init);

    Material findByCode(String code);

    List<Material> findByPcbDecal(String pcbDecal);

    boolean existPcbDecal(String pcbDecal);

    String emptyCode(String code);

    List<Material> findLike(String like, long first, long size);

    long countLike(String like);

    void deleteAll();

    void save(Material material);

    void delete(Material material);

    List<Material> findAll();

    void saveAll(List<Material> materials);

    void deleteAll(Collection<Material> materials);

    List<Material> findLikeByExample(Material example, long first, long size);

    long countLikeByExample(Material example);

    List<Material> findAll(long first, long size);

    long countAll();
}
